{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.5.2\n"
     ]
    }
   ],
   "source": [
    "import paddle\n",
    "import paddle.nn.functional as F\n",
    "from paddle.nn import Linear\n",
    "import numpy as np \n",
    "import os\n",
    "import json\n",
    "import random\n",
    "print(paddle.__version__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from paddle.nn import Conv2D,MaxPool2D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_data(mode='train'):\n",
    "    with open('../desktop/mnist.json') as f:\n",
    "        data = json.load(f)\n",
    "    train_set,val_set,eval_set=data\n",
    "\n",
    "    if mode== 'train': \n",
    "        imgs, labels = train_set[0], train_set[1] \n",
    "    elif mode=='valid':\n",
    "        imgs, labels= val_set[0],val_set[1] \n",
    "    elif mode== 'eval':\n",
    "        imgs, labels = eva_set[0], eval_set[1] \n",
    "    else:\n",
    "        raise Exception( \"mode can only be one of[ 'train' , 'valid', 'eval' ]\" ) \n",
    "    print(\"训练数据集数量:\",len(imgs))\n",
    "    imgs_length=len(imgs)\n",
    "    index_list=list(range(imgs_length))\n",
    "    BATCHSIZE=100\n",
    "\n",
    "    def data_generator(): \n",
    "        if mode == 'train':\n",
    "            random.shuffle(index_list)\n",
    "            imgs_list=[]\n",
    "            labels_list=[]\n",
    "            for i in index_list:\n",
    "                img=np.array(imgs[i]).astype('float32')\n",
    "                label=np.reshape(labels[i],[1].astype('int64'))\n",
    "                imgs_list.append(img)\n",
    "                labels_list.append(lable)\n",
    "                if len(imgs_list) ==BATCHSIZE:\n",
    "                    yield np.array(imgs_list), np.array(labels_list)\n",
    "                    imgs_list=[]\n",
    "                    lables_list=[]\n",
    "            if len(imgs_list) >0: \n",
    "                yield np.array(imgs_list),np.array(lables_list)\n",
    "            return data_generator"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_data(mode='train'):\n",
    "    with open('../Desktop/new_mnist.json') as f:\n",
    "        data = json.load(f)\n",
    "\n",
    "    train_set, val_set, eval_set = data\n",
    "    if mode== 'train':\n",
    "\n",
    "        imgs, labels = train_set[0], train_set[1] \n",
    "    elif mode=='valid':\n",
    "        imgs, labels = val_set[0],val_set[1] \n",
    "    elif mode== 'eval':\n",
    "        imgs, labels = eva_set[0], eval_set[1] \n",
    "    else:\n",
    "        raise Exception( \"mode can only be one of[ 'train' , 'valid', 'eval' ]\" ) \n",
    "    print(\"训练数据集数量:\",len(imgs))\n",
    "\n",
    "    imgs_length =len(imgs)\n",
    "    index_list = list(range(imgs_length)) \n",
    "    BATCHSIZE=100\n",
    "\n",
    "    def data_generator(): \n",
    "        if mode == 'train':\n",
    "            random.shuffle(index_list)\n",
    "            imgs_list=[]\n",
    "            labels_list=[]\n",
    "            for i in index_list:\n",
    "                #img =np.array(imgs[i]).astype('float32')\n",
    "                img = np.reshape(imgs[i],[1,28, 28]).astype('float32' )\n",
    "                label = np.reshape(labels[i],[1]).astype('int64') \n",
    "                imgs_list.append(img) \n",
    "                labels_list.append(label)\n",
    "                if len(imgs_list) ==BATCHSIZE:\n",
    "                    yield np.array(imgs_list), np.array(labels_list)\n",
    "                    imgs_list = []\n",
    "                    labels_list = []\n",
    "                if len(imgs_list) >0:\n",
    "                    yield np.array(imgs_list),np.array(labels_list)\n",
    "    return data_generator"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "class LeNetModel(paddle.nn.Layer):\n",
    "    def __init__(self):\n",
    "        super(LeNetModel,self).__init__()\n",
    "        \n",
    "        self.conv1 = paddle.nn.Conv2D(in_channels=1, out_channels=6, kernel_size=5,stride=1)\n",
    "\n",
    "        self.pool1 = paddle.nn.MaxPool2D(kernel_size=2,stride=2)\n",
    "        self.conv2 = paddle.nn.Conv2D(in_channels=6, out_channels=16, kernel_size=5, stride=1)\n",
    "        self.pool2 = paddle.nn.MaxPool2D(kernel_size=2,stride=2)\n",
    "        self.fc1=paddle.nn.Linear(256,120)\n",
    "        self.fc2=paddle.nn.Linear(120,84)\n",
    "        self.fc3=paddle.nn.Linear(84,10)\n",
    "\n",
    "    def forward(self,x):\n",
    "        \n",
    "        x=self.conv1(x) \n",
    "        x=F.relu(x) \n",
    "        x=self.pool1(x) \n",
    "        x=self.conv2(x) \n",
    "        x=F.relu(x) \n",
    "        x=self.pool2(x)\n",
    "        x=paddle.flatten(x, start_axis=1, stop_axis=-1) \n",
    "        x=self.fc1(x) \n",
    "        x=F.relu(x) \n",
    "        x=self.fc2(x) \n",
    "        x =F.relu(x) \n",
    "        x=self.fc3(x) \n",
    "        return x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def train(model):\n",
    "    model.train()\n",
    "    opt = paddle.optimizer.SGD(learning_rate=0.01,parameters=model.parameters())\n",
    "\n",
    "    EPOCH_NUM =5\n",
    "    for epoch_id in range(EPOCH_NUM):\n",
    "        for batch_id, data in enumerate(train_loader()):\n",
    "            images, labels = data\n",
    "            images = paddle.to_tensor(images) \n",
    "            labels = paddle.to_tensor(labels)\n",
    "\n",
    "            predicts = model(images)\n",
    "            #loss = F.cross_entropy(predicts,labels)\n",
    "            loss = F.softmax_with_cross_entropy(predicts,labels) \n",
    "            avg_loss = paddle.mean(loss)\n",
    "            if batch_id % 200 ==0:\n",
    "                print( \"epoch: {}, batch: {}, loss is; {}\" .format(epoch_id, batch_id, avg_loss.numpy()))\n",
    "                \n",
    "            avg_loss.backward()\n",
    "            opt.step()\n",
    "            opt.clear_grad()\n",
    "        model.eval() \n",
    "        accuracies =[] \n",
    "        losses =[]\n",
    "        for batch_id, data in enumerate(valid_loader()):\n",
    "            images, labels = data\n",
    "            images = paddle.to_tensor(images) \n",
    "            labels = paddle.to_tensor(labels)\n",
    "            logits = model(images) \n",
    "            pred =F.softmax(logits)\n",
    "            #loss =F.cross_entropy(predicts,labels)\n",
    "            loss = F.softmax_with_cross_entropy(logits, labels)\n",
    "            acc = paddle.metric.accuracy(pred,labels) \n",
    "            accuracies.append(acc.numpy())\n",
    "            losses.append(loss.numpy())\n",
    "            print(\"[validation] accuracy/loss: {}/{}\" .format(np.mean(accuracies), np.mean(losses)))\n",
    "        model.train()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "训练数据集数量: 50000\n",
      "训练数据集数量: 10000\n",
      "epoch: 0, batch: 0, loss is; [1.9706175]\n",
      "epoch: 0, batch: 200, loss is; [0.03536208]\n",
      "epoch: 0, batch: 400, loss is; [0.6127533]\n",
      "epoch: 0, batch: 600, loss is; [0.03617578]\n",
      "epoch: 0, batch: 800, loss is; [0.00150209]\n",
      "epoch: 0, batch: 1000, loss is; [0.22893402]\n",
      "epoch: 0, batch: 1200, loss is; [0.00662076]\n",
      "epoch: 0, batch: 1400, loss is; [0.9149731]\n",
      "epoch: 0, batch: 1600, loss is; [0.2588818]\n",
      "epoch: 0, batch: 1800, loss is; [0.00449755]\n",
      "epoch: 0, batch: 2000, loss is; [2.9358473]\n",
      "epoch: 0, batch: 2200, loss is; [0.00410265]\n",
      "epoch: 0, batch: 2400, loss is; [3.9459053e-05]\n",
      "epoch: 0, batch: 2600, loss is; [0.31231976]\n",
      "epoch: 0, batch: 2800, loss is; [0.00231379]\n",
      "epoch: 0, batch: 3000, loss is; [0.0005769]\n",
      "epoch: 0, batch: 3200, loss is; [0.]\n",
      "epoch: 0, batch: 3400, loss is; [1.9669726e-05]\n",
      "epoch: 0, batch: 3600, loss is; [0.00069022]\n",
      "epoch: 0, batch: 3800, loss is; [0.]\n",
      "epoch: 0, batch: 4000, loss is; [0.01080096]\n",
      "epoch: 0, batch: 4200, loss is; [4.1096787]\n",
      "epoch: 0, batch: 4400, loss is; [0.00268599]\n",
      "epoch: 0, batch: 4600, loss is; [0.7184825]\n",
      "epoch: 0, batch: 4800, loss is; [2.4628966]\n",
      "epoch: 0, batch: 5000, loss is; [0.2627792]\n",
      "epoch: 0, batch: 5200, loss is; [1.8757908]\n",
      "epoch: 0, batch: 5400, loss is; [0.00420009]\n",
      "epoch: 0, batch: 5600, loss is; [0.0004754]\n",
      "epoch: 0, batch: 5800, loss is; [1.3947584e-05]\n",
      "epoch: 0, batch: 6000, loss is; [1.1921e-05]\n",
      "epoch: 0, batch: 6200, loss is; [3.2067812e-05]\n",
      "epoch: 0, batch: 6400, loss is; [0.02701254]\n",
      "epoch: 0, batch: 6600, loss is; [0.00010217]\n",
      "epoch: 0, batch: 6800, loss is; [1.3113031e-06]\n",
      "epoch: 0, batch: 7000, loss is; [0.00041738]\n",
      "epoch: 0, batch: 7200, loss is; [0.00603616]\n",
      "epoch: 0, batch: 7400, loss is; [1.5974172e-05]\n",
      "epoch: 0, batch: 7600, loss is; [2.2292386e-05]\n",
      "epoch: 0, batch: 7800, loss is; [4.768383e-06]\n",
      "epoch: 0, batch: 8000, loss is; [2.384186e-07]\n",
      "epoch: 0, batch: 8200, loss is; [7.867844e-06]\n",
      "epoch: 0, batch: 8400, loss is; [4.649173e-06]\n",
      "epoch: 0, batch: 8600, loss is; [1.668944e-05]\n",
      "epoch: 0, batch: 8800, loss is; [0.0020752]\n",
      "epoch: 0, batch: 9000, loss is; [0.00041106]\n",
      "epoch: 0, batch: 9200, loss is; [0.03858983]\n",
      "epoch: 0, batch: 9400, loss is; [0.00079944]\n",
      "epoch: 0, batch: 9600, loss is; [0.00042251]\n",
      "epoch: 0, batch: 9800, loss is; [0.]\n",
      "epoch: 0, batch: 10000, loss is; [0.]\n",
      "epoch: 0, batch: 10200, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 10400, loss is; [7.15256e-07]\n",
      "epoch: 0, batch: 10600, loss is; [0.00046443]\n",
      "epoch: 0, batch: 10800, loss is; [3.3140732e-05]\n",
      "epoch: 0, batch: 11000, loss is; [0.]\n",
      "epoch: 0, batch: 11200, loss is; [1.4305125e-06]\n",
      "epoch: 0, batch: 11400, loss is; [0.00013937]\n",
      "epoch: 0, batch: 11600, loss is; [0.]\n",
      "epoch: 0, batch: 11800, loss is; [0.00377335]\n",
      "epoch: 0, batch: 12000, loss is; [1.9073505e-06]\n",
      "epoch: 0, batch: 12200, loss is; [1.7404707e-05]\n",
      "epoch: 0, batch: 12400, loss is; [0.00068354]\n",
      "epoch: 0, batch: 12600, loss is; [8.940737e-06]\n",
      "epoch: 0, batch: 12800, loss is; [0.00098492]\n",
      "epoch: 0, batch: 13000, loss is; [1.7881409e-06]\n",
      "epoch: 0, batch: 13200, loss is; [4.3750766e-05]\n",
      "epoch: 0, batch: 13400, loss is; [0.6945853]\n",
      "epoch: 0, batch: 13600, loss is; [0.00016035]\n",
      "epoch: 0, batch: 13800, loss is; [3.5762793e-07]\n",
      "epoch: 0, batch: 14000, loss is; [7.15256e-07]\n",
      "epoch: 0, batch: 14200, loss is; [0.]\n",
      "epoch: 0, batch: 14400, loss is; [9.9663936e-05]\n",
      "epoch: 0, batch: 14600, loss is; [0.47169957]\n",
      "epoch: 0, batch: 14800, loss is; [1.1205736e-05]\n",
      "epoch: 0, batch: 15000, loss is; [2.861027e-06]\n",
      "epoch: 0, batch: 15200, loss is; [2.02656e-06]\n",
      "epoch: 0, batch: 15400, loss is; [0.00089178]\n",
      "epoch: 0, batch: 15600, loss is; [0.00081173]\n",
      "epoch: 0, batch: 15800, loss is; [0.]\n",
      "epoch: 0, batch: 16000, loss is; [6.675943e-05]\n",
      "epoch: 0, batch: 16200, loss is; [1.7979676]\n",
      "epoch: 0, batch: 16400, loss is; [3.5404654]\n",
      "epoch: 0, batch: 16600, loss is; [0.00554217]\n",
      "epoch: 0, batch: 16800, loss is; [8.344685e-06]\n",
      "epoch: 0, batch: 17000, loss is; [2.3591733]\n",
      "epoch: 0, batch: 17200, loss is; [6.198902e-06]\n",
      "epoch: 0, batch: 17400, loss is; [0.20558345]\n",
      "epoch: 0, batch: 17600, loss is; [0.03154297]\n",
      "epoch: 0, batch: 17800, loss is; [1.7404707e-05]\n",
      "epoch: 0, batch: 18000, loss is; [0.00015618]\n",
      "epoch: 0, batch: 18200, loss is; [3.0994463e-06]\n",
      "epoch: 0, batch: 18400, loss is; [0.]\n",
      "epoch: 0, batch: 18600, loss is; [0.00246447]\n",
      "epoch: 0, batch: 18800, loss is; [7.15256e-07]\n",
      "epoch: 0, batch: 19000, loss is; [6.735552e-05]\n",
      "epoch: 0, batch: 19200, loss is; [0.0011891]\n",
      "epoch: 0, batch: 19400, loss is; [0.04087194]\n",
      "epoch: 0, batch: 19600, loss is; [0.4025502]\n",
      "epoch: 0, batch: 19800, loss is; [1.2213787]\n",
      "epoch: 0, batch: 20000, loss is; [0.42044955]\n",
      "epoch: 0, batch: 20200, loss is; [1.2636265e-05]\n",
      "epoch: 0, batch: 20400, loss is; [0.]\n",
      "epoch: 0, batch: 20600, loss is; [7.15256e-07]\n",
      "epoch: 0, batch: 20800, loss is; [0.]\n",
      "epoch: 0, batch: 21000, loss is; [3.5762793e-07]\n",
      "epoch: 0, batch: 21200, loss is; [0.00029765]\n",
      "epoch: 0, batch: 21400, loss is; [0.00799548]\n",
      "epoch: 0, batch: 21600, loss is; [7.5102134e-06]\n",
      "epoch: 0, batch: 21800, loss is; [0.00017865]\n",
      "epoch: 0, batch: 22000, loss is; [2.002736e-05]\n",
      "epoch: 0, batch: 22200, loss is; [1.2546188]\n",
      "epoch: 0, batch: 22400, loss is; [0.]\n",
      "epoch: 0, batch: 22600, loss is; [3.0518044e-05]\n",
      "epoch: 0, batch: 22800, loss is; [0.00258864]\n",
      "epoch: 0, batch: 23000, loss is; [0.]\n",
      "epoch: 0, batch: 23200, loss is; [0.0004534]\n",
      "epoch: 0, batch: 23400, loss is; [0.]\n",
      "epoch: 0, batch: 23600, loss is; [0.]\n",
      "epoch: 0, batch: 23800, loss is; [1.5974172e-05]\n",
      "epoch: 0, batch: 24000, loss is; [8.8215265e-06]\n",
      "epoch: 0, batch: 24200, loss is; [0.00010276]\n",
      "epoch: 0, batch: 24400, loss is; [0.00613439]\n",
      "epoch: 0, batch: 24600, loss is; [0.0014726]\n",
      "epoch: 0, batch: 24800, loss is; [0.]\n",
      "epoch: 0, batch: 25000, loss is; [0.01165299]\n",
      "epoch: 0, batch: 25200, loss is; [2.1457695e-06]\n",
      "epoch: 0, batch: 25400, loss is; [2.384186e-07]\n",
      "epoch: 0, batch: 25600, loss is; [0.]\n",
      "epoch: 0, batch: 25800, loss is; [4.768373e-07]\n",
      "epoch: 0, batch: 26000, loss is; [0.]\n",
      "epoch: 0, batch: 26200, loss is; [0.00028167]\n",
      "epoch: 0, batch: 26400, loss is; [0.00102227]\n",
      "epoch: 0, batch: 26600, loss is; [1.43052175e-05]\n",
      "epoch: 0, batch: 26800, loss is; [7.081283e-05]\n",
      "epoch: 0, batch: 27000, loss is; [0.00024328]\n",
      "epoch: 0, batch: 27200, loss is; [9.77521e-06]\n",
      "epoch: 0, batch: 27400, loss is; [4.768373e-07]\n",
      "epoch: 0, batch: 27600, loss is; [0.00155092]\n",
      "epoch: 0, batch: 27800, loss is; [0.00445385]\n",
      "epoch: 0, batch: 28000, loss is; [0.00045387]\n",
      "epoch: 0, batch: 28200, loss is; [8.106264e-06]\n",
      "epoch: 0, batch: 28400, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 28600, loss is; [0.00052102]\n",
      "epoch: 0, batch: 28800, loss is; [0.02691163]\n",
      "epoch: 0, batch: 29000, loss is; [9.709385]\n",
      "epoch: 0, batch: 29200, loss is; [7.987054e-06]\n",
      "epoch: 0, batch: 29400, loss is; [0.00039877]\n",
      "epoch: 0, batch: 29600, loss is; [6.8428475e-05]\n",
      "epoch: 0, batch: 29800, loss is; [0.00677893]\n",
      "epoch: 0, batch: 30000, loss is; [0.00217382]\n",
      "epoch: 0, batch: 30200, loss is; [7.629424e-06]\n",
      "epoch: 0, batch: 30400, loss is; [0.00010777]\n",
      "epoch: 0, batch: 30600, loss is; [0.00320602]\n",
      "epoch: 0, batch: 30800, loss is; [0.00073776]\n",
      "epoch: 0, batch: 31000, loss is; [0.]\n",
      "epoch: 0, batch: 31200, loss is; [2.2411597e-05]\n",
      "epoch: 0, batch: 31400, loss is; [1.9073505e-06]\n",
      "epoch: 0, batch: 31600, loss is; [2.3188603]\n",
      "epoch: 0, batch: 31800, loss is; [0.00067149]\n",
      "epoch: 0, batch: 32000, loss is; [0.00038452]\n",
      "epoch: 0, batch: 32200, loss is; [0.]\n",
      "epoch: 0, batch: 32400, loss is; [0.0001408]\n",
      "epoch: 0, batch: 32600, loss is; [0.00017972]\n",
      "epoch: 0, batch: 32800, loss is; [2.384186e-07]\n",
      "epoch: 0, batch: 33000, loss is; [3.0160405e-05]\n",
      "epoch: 0, batch: 33200, loss is; [0.00030009]\n",
      "epoch: 0, batch: 33400, loss is; [3.5762793e-07]\n",
      "epoch: 0, batch: 33600, loss is; [0.]\n",
      "epoch: 0, batch: 33800, loss is; [0.00035304]\n",
      "epoch: 0, batch: 34000, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 34200, loss is; [0.00133317]\n",
      "epoch: 0, batch: 34400, loss is; [9.441822e-05]\n",
      "epoch: 0, batch: 34600, loss is; [0.00222352]\n",
      "epoch: 0, batch: 34800, loss is; [1.1912106]\n",
      "epoch: 0, batch: 35000, loss is; [1.0609683e-05]\n",
      "epoch: 0, batch: 35200, loss is; [1.0728842e-06]\n",
      "epoch: 0, batch: 35400, loss is; [5.7818175e-05]\n",
      "epoch: 0, batch: 35600, loss is; [0.]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 0, batch: 35800, loss is; [0.00269155]\n",
      "epoch: 0, batch: 36000, loss is; [2.384186e-07]\n",
      "epoch: 0, batch: 36200, loss is; [0.]\n",
      "epoch: 0, batch: 36400, loss is; [0.00050462]\n",
      "epoch: 0, batch: 36600, loss is; [3.111411e-05]\n",
      "epoch: 0, batch: 36800, loss is; [3.218656e-06]\n",
      "epoch: 0, batch: 37000, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 37200, loss is; [7.15256e-07]\n",
      "epoch: 0, batch: 37400, loss is; [0.00036139]\n",
      "epoch: 0, batch: 37600, loss is; [1.3113031e-06]\n",
      "epoch: 0, batch: 37800, loss is; [0.]\n",
      "epoch: 0, batch: 38000, loss is; [0.08069767]\n",
      "epoch: 0, batch: 38200, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 38400, loss is; [3.3378658e-06]\n",
      "epoch: 0, batch: 38600, loss is; [0.]\n",
      "epoch: 0, batch: 38800, loss is; [0.00015188]\n",
      "epoch: 0, batch: 39000, loss is; [1.4186006e-05]\n",
      "epoch: 0, batch: 39200, loss is; [0.]\n",
      "epoch: 0, batch: 39400, loss is; [1.1920936e-06]\n",
      "epoch: 0, batch: 39600, loss is; [0.]\n",
      "epoch: 0, batch: 39800, loss is; [1.4782061e-05]\n",
      "epoch: 0, batch: 40000, loss is; [0.00883128]\n",
      "epoch: 0, batch: 40200, loss is; [1.7881409e-06]\n",
      "epoch: 0, batch: 40400, loss is; [0.]\n",
      "epoch: 0, batch: 40600, loss is; [1.6689314e-06]\n",
      "epoch: 0, batch: 40800, loss is; [9.536748e-07]\n",
      "epoch: 0, batch: 41000, loss is; [0.]\n",
      "epoch: 0, batch: 41200, loss is; [5.8414258e-05]\n",
      "epoch: 0, batch: 41400, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 41600, loss is; [1.549722e-06]\n",
      "epoch: 0, batch: 41800, loss is; [0.]\n",
      "epoch: 0, batch: 42000, loss is; [0.]\n",
      "epoch: 0, batch: 42200, loss is; [0.3639161]\n",
      "epoch: 0, batch: 42400, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 42600, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 42800, loss is; [0.08511214]\n",
      "epoch: 0, batch: 43000, loss is; [2.2292386e-05]\n",
      "epoch: 0, batch: 43200, loss is; [0.00032323]\n",
      "epoch: 0, batch: 43400, loss is; [0.00161008]\n",
      "epoch: 0, batch: 43600, loss is; [0.00137889]\n",
      "epoch: 0, batch: 43800, loss is; [0.]\n",
      "epoch: 0, batch: 44000, loss is; [6.0917802e-05]\n",
      "epoch: 0, batch: 44200, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 44400, loss is; [2.384186e-07]\n",
      "epoch: 0, batch: 44600, loss is; [0.]\n",
      "epoch: 0, batch: 44800, loss is; [8.011185e-05]\n",
      "epoch: 0, batch: 45000, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 45200, loss is; [0.]\n",
      "epoch: 0, batch: 45400, loss is; [2.1577114e-05]\n",
      "epoch: 0, batch: 45600, loss is; [0.]\n",
      "epoch: 0, batch: 45800, loss is; [0.]\n",
      "epoch: 0, batch: 46000, loss is; [0.00020882]\n",
      "epoch: 0, batch: 46200, loss is; [0.]\n",
      "epoch: 0, batch: 46400, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 46600, loss is; [0.00025961]\n",
      "epoch: 0, batch: 46800, loss is; [0.]\n",
      "epoch: 0, batch: 47000, loss is; [0.0092452]\n",
      "epoch: 0, batch: 47200, loss is; [9.536748e-07]\n",
      "epoch: 0, batch: 47400, loss is; [0.00034135]\n",
      "epoch: 0, batch: 47600, loss is; [9.014748]\n",
      "epoch: 0, batch: 47800, loss is; [0.02091589]\n",
      "epoch: 0, batch: 48000, loss is; [0.00010658]\n",
      "epoch: 0, batch: 48200, loss is; [1.192093e-07]\n",
      "epoch: 0, batch: 48400, loss is; [4.0055125e-05]\n",
      "epoch: 0, batch: 48600, loss is; [0.00045507]\n",
      "epoch: 0, batch: 48800, loss is; [6.927212]\n",
      "epoch: 0, batch: 49000, loss is; [0.]\n",
      "epoch: 0, batch: 49200, loss is; [0.]\n",
      "epoch: 0, batch: 49400, loss is; [0.]\n",
      "epoch: 0, batch: 49600, loss is; [0.05743326]\n",
      "epoch: 0, batch: 49800, loss is; [0.]\n",
      "epoch: 1, batch: 0, loss is; [0.]\n",
      "epoch: 1, batch: 200, loss is; [0.]\n",
      "epoch: 1, batch: 400, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 600, loss is; [0.23888181]\n",
      "epoch: 1, batch: 800, loss is; [0.]\n",
      "epoch: 1, batch: 1000, loss is; [4.768373e-07]\n",
      "epoch: 1, batch: 1200, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 1400, loss is; [0.00035173]\n",
      "epoch: 1, batch: 1600, loss is; [0.]\n",
      "epoch: 1, batch: 1800, loss is; [0.]\n",
      "epoch: 1, batch: 2000, loss is; [1.0728893e-05]\n",
      "epoch: 1, batch: 2200, loss is; [1.1324947e-05]\n",
      "epoch: 1, batch: 2400, loss is; [1.573575e-05]\n",
      "epoch: 1, batch: 2600, loss is; [0.00062115]\n",
      "epoch: 1, batch: 2800, loss is; [0.]\n",
      "epoch: 1, batch: 3000, loss is; [3.8147045e-06]\n",
      "epoch: 1, batch: 3200, loss is; [1.4305125e-06]\n",
      "epoch: 1, batch: 3400, loss is; [0.]\n",
      "epoch: 1, batch: 3600, loss is; [0.00011063]\n",
      "epoch: 1, batch: 3800, loss is; [1.0728842e-06]\n",
      "epoch: 1, batch: 4000, loss is; [0.00186092]\n",
      "epoch: 1, batch: 4200, loss is; [0.]\n",
      "epoch: 1, batch: 4400, loss is; [0.0022697]\n",
      "epoch: 1, batch: 4600, loss is; [4.029355e-05]\n",
      "epoch: 1, batch: 4800, loss is; [0.]\n",
      "epoch: 1, batch: 5000, loss is; [0.]\n",
      "epoch: 1, batch: 5200, loss is; [0.]\n",
      "epoch: 1, batch: 5400, loss is; [0.01151382]\n",
      "epoch: 1, batch: 5600, loss is; [0.]\n",
      "epoch: 1, batch: 5800, loss is; [3.3140732e-05]\n",
      "epoch: 1, batch: 6000, loss is; [0.25473616]\n",
      "epoch: 1, batch: 6200, loss is; [2.264979e-06]\n",
      "epoch: 1, batch: 6400, loss is; [0.]\n",
      "epoch: 1, batch: 6600, loss is; [2.372293e-05]\n",
      "epoch: 1, batch: 6800, loss is; [0.00501493]\n",
      "epoch: 1, batch: 7000, loss is; [1.2040211e-05]\n",
      "epoch: 1, batch: 7200, loss is; [2.4318992e-05]\n",
      "epoch: 1, batch: 7400, loss is; [4.4466055e-05]\n",
      "epoch: 1, batch: 7600, loss is; [2.133869e-05]\n",
      "epoch: 1, batch: 7800, loss is; [0.]\n",
      "epoch: 1, batch: 8000, loss is; [0.00786564]\n",
      "epoch: 1, batch: 8200, loss is; [0.]\n",
      "epoch: 1, batch: 8400, loss is; [0.0025452]\n",
      "epoch: 1, batch: 8600, loss is; [5.960466e-07]\n",
      "epoch: 1, batch: 8800, loss is; [0.]\n",
      "epoch: 1, batch: 9000, loss is; [9.799484e-05]\n",
      "epoch: 1, batch: 9200, loss is; [0.09879424]\n",
      "epoch: 1, batch: 9400, loss is; [0.]\n",
      "epoch: 1, batch: 9600, loss is; [0.00097406]\n",
      "epoch: 1, batch: 9800, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 10000, loss is; [0.00855921]\n",
      "epoch: 1, batch: 10200, loss is; [0.]\n",
      "epoch: 1, batch: 10400, loss is; [8.3446537e-07]\n",
      "epoch: 1, batch: 10600, loss is; [7.5700766e-05]\n",
      "epoch: 1, batch: 10800, loss is; [3.9933877]\n",
      "epoch: 1, batch: 11000, loss is; [0.06446897]\n",
      "epoch: 1, batch: 11200, loss is; [0.00948268]\n",
      "epoch: 1, batch: 11400, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 11600, loss is; [0.05940474]\n",
      "epoch: 1, batch: 11800, loss is; [0.]\n",
      "epoch: 1, batch: 12000, loss is; [4.3631553e-05]\n",
      "epoch: 1, batch: 12200, loss is; [0.13774994]\n",
      "epoch: 1, batch: 12400, loss is; [6.3302134e-05]\n",
      "epoch: 1, batch: 12600, loss is; [1.5020483e-05]\n",
      "epoch: 1, batch: 12800, loss is; [0.]\n",
      "epoch: 1, batch: 13000, loss is; [1.7881409e-06]\n",
      "epoch: 1, batch: 13200, loss is; [0.]\n",
      "epoch: 1, batch: 13400, loss is; [0.]\n",
      "epoch: 1, batch: 13600, loss is; [2.264979e-06]\n",
      "epoch: 1, batch: 13800, loss is; [0.]\n",
      "epoch: 1, batch: 14000, loss is; [0.]\n",
      "epoch: 1, batch: 14200, loss is; [2.0981055e-05]\n",
      "epoch: 1, batch: 14400, loss is; [0.]\n",
      "epoch: 1, batch: 14600, loss is; [5.960466e-07]\n",
      "epoch: 1, batch: 14800, loss is; [1.7881409e-06]\n",
      "epoch: 1, batch: 15000, loss is; [0.]\n",
      "epoch: 1, batch: 15200, loss is; [0.]\n",
      "epoch: 1, batch: 15400, loss is; [0.01602317]\n",
      "epoch: 1, batch: 15600, loss is; [0.]\n",
      "epoch: 1, batch: 15800, loss is; [0.]\n",
      "epoch: 1, batch: 16000, loss is; [0.0005537]\n",
      "epoch: 1, batch: 16200, loss is; [9.536748e-07]\n",
      "epoch: 1, batch: 16400, loss is; [0.00554001]\n",
      "epoch: 1, batch: 16600, loss is; [0.00055621]\n",
      "epoch: 1, batch: 16800, loss is; [1.4305125e-06]\n",
      "epoch: 1, batch: 17000, loss is; [0.]\n",
      "epoch: 1, batch: 17200, loss is; [0.00031273]\n",
      "epoch: 1, batch: 17400, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 17600, loss is; [0.]\n",
      "epoch: 1, batch: 17800, loss is; [0.00673207]\n",
      "epoch: 1, batch: 18000, loss is; [0.00155421]\n",
      "epoch: 1, batch: 18200, loss is; [6.5435233]\n",
      "epoch: 1, batch: 18400, loss is; [0.00652956]\n",
      "epoch: 1, batch: 18600, loss is; [0.00548667]\n",
      "epoch: 1, batch: 18800, loss is; [8.3446537e-07]\n",
      "epoch: 1, batch: 19000, loss is; [0.00030057]\n",
      "epoch: 1, batch: 19200, loss is; [4.649173e-06]\n",
      "epoch: 1, batch: 19400, loss is; [0.]\n",
      "epoch: 1, batch: 19600, loss is; [0.]\n",
      "epoch: 1, batch: 19800, loss is; [4.243941e-05]\n",
      "epoch: 1, batch: 20000, loss is; [6.5565323e-06]\n",
      "epoch: 1, batch: 20200, loss is; [1.7762342e-05]\n",
      "epoch: 1, batch: 20400, loss is; [0.]\n",
      "epoch: 1, batch: 20600, loss is; [1.1086526e-05]\n",
      "epoch: 1, batch: 20800, loss is; [0.]\n",
      "epoch: 1, batch: 21000, loss is; [8.297311e-05]\n",
      "epoch: 1, batch: 21200, loss is; [0.00022778]\n",
      "epoch: 1, batch: 21400, loss is; [8.130404e-05]\n",
      "epoch: 1, batch: 21600, loss is; [0.]\n",
      "epoch: 1, batch: 21800, loss is; [0.00014163]\n",
      "epoch: 1, batch: 22000, loss is; [4.768373e-07]\n",
      "epoch: 1, batch: 22200, loss is; [0.00016667]\n",
      "epoch: 1, batch: 22400, loss is; [0.01860808]\n",
      "epoch: 1, batch: 22600, loss is; [2.384186e-07]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 1, batch: 22800, loss is; [0.]\n",
      "epoch: 1, batch: 23000, loss is; [0.]\n",
      "epoch: 1, batch: 23200, loss is; [0.0005252]\n",
      "epoch: 1, batch: 23400, loss is; [2.264979e-06]\n",
      "epoch: 1, batch: 23600, loss is; [7.15256e-07]\n",
      "epoch: 1, batch: 23800, loss is; [0.]\n",
      "epoch: 1, batch: 24000, loss is; [1.8954457e-05]\n",
      "epoch: 1, batch: 24200, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 24400, loss is; [0.]\n",
      "epoch: 1, batch: 24600, loss is; [0.]\n",
      "epoch: 1, batch: 24800, loss is; [0.]\n",
      "epoch: 1, batch: 25000, loss is; [0.]\n",
      "epoch: 1, batch: 25200, loss is; [2.02656e-06]\n",
      "epoch: 1, batch: 25400, loss is; [0.]\n",
      "epoch: 1, batch: 25600, loss is; [0.]\n",
      "epoch: 1, batch: 25800, loss is; [11.755384]\n",
      "epoch: 1, batch: 26000, loss is; [3.2544667e-05]\n",
      "epoch: 1, batch: 26200, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 26400, loss is; [0.35523877]\n",
      "epoch: 1, batch: 26600, loss is; [1.4066795e-05]\n",
      "epoch: 1, batch: 26800, loss is; [0.]\n",
      "epoch: 1, batch: 27000, loss is; [1.7166285e-05]\n",
      "epoch: 1, batch: 27200, loss is; [0.]\n",
      "epoch: 1, batch: 27400, loss is; [1.3113031e-06]\n",
      "epoch: 1, batch: 27600, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 27800, loss is; [1.1324947e-05]\n",
      "epoch: 1, batch: 28000, loss is; [6.7949527e-06]\n",
      "epoch: 1, batch: 28200, loss is; [5.453353]\n",
      "epoch: 1, batch: 28400, loss is; [0.00221754]\n",
      "epoch: 1, batch: 28600, loss is; [0.00050271]\n",
      "epoch: 1, batch: 28800, loss is; [3.6954948e-06]\n",
      "epoch: 1, batch: 29000, loss is; [0.]\n",
      "epoch: 1, batch: 29200, loss is; [7.15256e-07]\n",
      "epoch: 1, batch: 29400, loss is; [7.808513e-05]\n",
      "epoch: 1, batch: 29600, loss is; [0.]\n",
      "epoch: 1, batch: 29800, loss is; [4.1008836e-05]\n",
      "epoch: 1, batch: 30000, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 30200, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 30400, loss is; [0.]\n",
      "epoch: 1, batch: 30600, loss is; [1.3113108e-05]\n",
      "epoch: 1, batch: 30800, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 31000, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 31200, loss is; [0.]\n",
      "epoch: 1, batch: 31400, loss is; [0.]\n",
      "epoch: 1, batch: 31600, loss is; [0.]\n",
      "epoch: 1, batch: 31800, loss is; [0.]\n",
      "epoch: 1, batch: 32000, loss is; [0.00025246]\n",
      "epoch: 1, batch: 32200, loss is; [0.]\n",
      "epoch: 1, batch: 32400, loss is; [1.5258905e-05]\n",
      "epoch: 1, batch: 32600, loss is; [3.5762793e-07]\n",
      "epoch: 1, batch: 32800, loss is; [3.6359495e-05]\n",
      "epoch: 1, batch: 33000, loss is; [0.]\n",
      "epoch: 1, batch: 33200, loss is; [2.2888446e-05]\n",
      "epoch: 1, batch: 33400, loss is; [0.00011063]\n",
      "epoch: 1, batch: 33600, loss is; [0.]\n",
      "epoch: 1, batch: 33800, loss is; [5.960466e-07]\n",
      "epoch: 1, batch: 34000, loss is; [0.]\n",
      "epoch: 1, batch: 34200, loss is; [0.]\n",
      "epoch: 1, batch: 34400, loss is; [0.]\n",
      "epoch: 1, batch: 34600, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 34800, loss is; [0.]\n",
      "epoch: 1, batch: 35000, loss is; [0.]\n",
      "epoch: 1, batch: 35200, loss is; [4.4107533e-06]\n",
      "epoch: 1, batch: 35400, loss is; [0.]\n",
      "epoch: 1, batch: 35600, loss is; [0.]\n",
      "epoch: 1, batch: 35800, loss is; [7.867844e-06]\n",
      "epoch: 1, batch: 36000, loss is; [4.768373e-07]\n",
      "epoch: 1, batch: 36200, loss is; [0.]\n",
      "epoch: 1, batch: 36400, loss is; [0.]\n",
      "epoch: 1, batch: 36600, loss is; [0.00079658]\n",
      "epoch: 1, batch: 36800, loss is; [7.15256e-07]\n",
      "epoch: 1, batch: 37000, loss is; [0.]\n",
      "epoch: 1, batch: 37200, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 37400, loss is; [0.00016667]\n",
      "epoch: 1, batch: 37600, loss is; [3.5762793e-07]\n",
      "epoch: 1, batch: 37800, loss is; [0.]\n",
      "epoch: 1, batch: 38000, loss is; [0.00359794]\n",
      "epoch: 1, batch: 38200, loss is; [0.]\n",
      "epoch: 1, batch: 38400, loss is; [0.]\n",
      "epoch: 1, batch: 38600, loss is; [2.1457695e-06]\n",
      "epoch: 1, batch: 38800, loss is; [5.1260126e-06]\n",
      "epoch: 1, batch: 39000, loss is; [0.00012816]\n",
      "epoch: 1, batch: 39200, loss is; [2.7418175e-06]\n",
      "epoch: 1, batch: 39400, loss is; [0.]\n",
      "epoch: 1, batch: 39600, loss is; [0.00018092]\n",
      "epoch: 1, batch: 39800, loss is; [0.]\n",
      "epoch: 1, batch: 40000, loss is; [0.02916997]\n",
      "epoch: 1, batch: 40200, loss is; [0.]\n",
      "epoch: 1, batch: 40400, loss is; [9.48951e-05]\n",
      "epoch: 1, batch: 40600, loss is; [0.]\n",
      "epoch: 1, batch: 40800, loss is; [0.00047254]\n",
      "epoch: 1, batch: 41000, loss is; [0.]\n",
      "epoch: 1, batch: 41200, loss is; [1.0728842e-06]\n",
      "epoch: 1, batch: 41400, loss is; [0.]\n",
      "epoch: 1, batch: 41600, loss is; [0.]\n",
      "epoch: 1, batch: 41800, loss is; [0.]\n",
      "epoch: 1, batch: 42000, loss is; [0.]\n",
      "epoch: 1, batch: 42200, loss is; [0.]\n",
      "epoch: 1, batch: 42400, loss is; [3.5762793e-07]\n",
      "epoch: 1, batch: 42600, loss is; [0.0001765]\n",
      "epoch: 1, batch: 42800, loss is; [0.]\n",
      "epoch: 1, batch: 43000, loss is; [0.]\n",
      "epoch: 1, batch: 43200, loss is; [0.]\n",
      "epoch: 1, batch: 43400, loss is; [2.1457903e-05]\n",
      "epoch: 1, batch: 43600, loss is; [3.5762793e-07]\n",
      "epoch: 1, batch: 43800, loss is; [0.]\n",
      "epoch: 1, batch: 44000, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 44200, loss is; [0.]\n",
      "epoch: 1, batch: 44400, loss is; [0.]\n",
      "epoch: 1, batch: 44600, loss is; [0.03408818]\n",
      "epoch: 1, batch: 44800, loss is; [4.768373e-07]\n",
      "epoch: 1, batch: 45000, loss is; [0.]\n",
      "epoch: 1, batch: 45200, loss is; [0.36483526]\n",
      "epoch: 1, batch: 45400, loss is; [0.04188777]\n",
      "epoch: 1, batch: 45600, loss is; [1.1563368e-05]\n",
      "epoch: 1, batch: 45800, loss is; [0.]\n",
      "epoch: 1, batch: 46000, loss is; [3.9339143e-06]\n",
      "epoch: 1, batch: 46200, loss is; [0.00031882]\n",
      "epoch: 1, batch: 46400, loss is; [0.00436626]\n",
      "epoch: 1, batch: 46600, loss is; [0.]\n",
      "epoch: 1, batch: 46800, loss is; [0.]\n",
      "epoch: 1, batch: 47000, loss is; [0.06828017]\n",
      "epoch: 1, batch: 47200, loss is; [0.]\n",
      "epoch: 1, batch: 47400, loss is; [6.461352e-05]\n",
      "epoch: 1, batch: 47600, loss is; [0.0409236]\n",
      "epoch: 1, batch: 47800, loss is; [2.63456e-05]\n",
      "epoch: 1, batch: 48000, loss is; [1.0728842e-06]\n",
      "epoch: 1, batch: 48200, loss is; [0.]\n",
      "epoch: 1, batch: 48400, loss is; [1.1920936e-06]\n",
      "epoch: 1, batch: 48600, loss is; [1.192093e-07]\n",
      "epoch: 1, batch: 48800, loss is; [0.00017376]\n",
      "epoch: 1, batch: 49000, loss is; [0.]\n",
      "epoch: 1, batch: 49200, loss is; [0.]\n",
      "epoch: 1, batch: 49400, loss is; [2.384186e-07]\n",
      "epoch: 1, batch: 49600, loss is; [0.04901055]\n",
      "epoch: 1, batch: 49800, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 0, loss is; [0.00100562]\n",
      "epoch: 2, batch: 200, loss is; [0.000315]\n",
      "epoch: 2, batch: 400, loss is; [0.]\n",
      "epoch: 2, batch: 600, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 800, loss is; [0.]\n",
      "epoch: 2, batch: 1000, loss is; [0.40331528]\n",
      "epoch: 2, batch: 1200, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 1400, loss is; [0.]\n",
      "epoch: 2, batch: 1600, loss is; [0.]\n",
      "epoch: 2, batch: 1800, loss is; [0.]\n",
      "epoch: 2, batch: 2000, loss is; [0.16710359]\n",
      "epoch: 2, batch: 2200, loss is; [0.]\n",
      "epoch: 2, batch: 2400, loss is; [1.5293034]\n",
      "epoch: 2, batch: 2600, loss is; [8.5665]\n",
      "epoch: 2, batch: 2800, loss is; [0.]\n",
      "epoch: 2, batch: 3000, loss is; [5.960466e-07]\n",
      "epoch: 2, batch: 3200, loss is; [0.]\n",
      "epoch: 2, batch: 3400, loss is; [0.04659722]\n",
      "epoch: 2, batch: 3600, loss is; [0.]\n",
      "epoch: 2, batch: 3800, loss is; [0.0002081]\n",
      "epoch: 2, batch: 4000, loss is; [0.]\n",
      "epoch: 2, batch: 4200, loss is; [1.0728842e-06]\n",
      "epoch: 2, batch: 4400, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 4600, loss is; [0.]\n",
      "epoch: 2, batch: 4800, loss is; [0.00011588]\n",
      "epoch: 2, batch: 5000, loss is; [3.4570753e-06]\n",
      "epoch: 2, batch: 5200, loss is; [5.960466e-07]\n",
      "epoch: 2, batch: 5400, loss is; [1.2755475e-05]\n",
      "epoch: 2, batch: 5600, loss is; [0.]\n",
      "epoch: 2, batch: 5800, loss is; [0.]\n",
      "epoch: 2, batch: 6000, loss is; [0.]\n",
      "epoch: 2, batch: 6200, loss is; [0.]\n",
      "epoch: 2, batch: 6400, loss is; [0.]\n",
      "epoch: 2, batch: 6600, loss is; [0.00038107]\n",
      "epoch: 2, batch: 6800, loss is; [2.1577114e-05]\n",
      "epoch: 2, batch: 7000, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 7200, loss is; [3.7670845e-05]\n",
      "epoch: 2, batch: 7400, loss is; [0.]\n",
      "epoch: 2, batch: 7600, loss is; [0.]\n",
      "epoch: 2, batch: 7800, loss is; [0.]\n",
      "epoch: 2, batch: 8000, loss is; [1.2278632e-05]\n",
      "epoch: 2, batch: 8200, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 8400, loss is; [0.]\n",
      "epoch: 2, batch: 8600, loss is; [0.]\n",
      "epoch: 2, batch: 8800, loss is; [2.264979e-06]\n",
      "epoch: 2, batch: 9000, loss is; [0.00123225]\n",
      "epoch: 2, batch: 9200, loss is; [5.960466e-07]\n",
      "epoch: 2, batch: 9400, loss is; [0.]\n",
      "epoch: 2, batch: 9600, loss is; [0.]\n",
      "epoch: 2, batch: 9800, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 10000, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 10200, loss is; [1.4305125e-06]\n",
      "epoch: 2, batch: 10400, loss is; [0.]\n",
      "epoch: 2, batch: 10600, loss is; [0.]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 2, batch: 10800, loss is; [2.682245e-05]\n",
      "epoch: 2, batch: 11000, loss is; [2.2292386e-05]\n",
      "epoch: 2, batch: 11200, loss is; [3.5762793e-07]\n",
      "epoch: 2, batch: 11400, loss is; [0.]\n",
      "epoch: 2, batch: 11600, loss is; [5.746053e-05]\n",
      "epoch: 2, batch: 11800, loss is; [3.8028487e-05]\n",
      "epoch: 2, batch: 12000, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 12200, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 12400, loss is; [0.00131055]\n",
      "epoch: 2, batch: 12600, loss is; [7.867844e-06]\n",
      "epoch: 2, batch: 12800, loss is; [1.4305125e-06]\n",
      "epoch: 2, batch: 13000, loss is; [0.]\n",
      "epoch: 2, batch: 13200, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 13400, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 13600, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 13800, loss is; [4.649173e-06]\n",
      "epoch: 2, batch: 14000, loss is; [0.]\n",
      "epoch: 2, batch: 14200, loss is; [0.]\n",
      "epoch: 2, batch: 14400, loss is; [1.9073505e-06]\n",
      "epoch: 2, batch: 14600, loss is; [0.00078053]\n",
      "epoch: 2, batch: 14800, loss is; [0.]\n",
      "epoch: 2, batch: 15000, loss is; [6.0796924e-06]\n",
      "epoch: 2, batch: 15200, loss is; [1.2636265e-05]\n",
      "epoch: 2, batch: 15400, loss is; [0.]\n",
      "epoch: 2, batch: 15600, loss is; [6.914163e-06]\n",
      "epoch: 2, batch: 15800, loss is; [5.3644326e-06]\n",
      "epoch: 2, batch: 16000, loss is; [0.]\n",
      "epoch: 2, batch: 16200, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 16400, loss is; [0.]\n",
      "epoch: 2, batch: 16600, loss is; [5.281111e-05]\n",
      "epoch: 2, batch: 16800, loss is; [1.0728842e-06]\n",
      "epoch: 2, batch: 17000, loss is; [0.]\n",
      "epoch: 2, batch: 17200, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 17400, loss is; [0.]\n",
      "epoch: 2, batch: 17600, loss is; [0.]\n",
      "epoch: 2, batch: 17800, loss is; [0.]\n",
      "epoch: 2, batch: 18000, loss is; [4.768373e-07]\n",
      "epoch: 2, batch: 18200, loss is; [0.]\n",
      "epoch: 2, batch: 18400, loss is; [0.]\n",
      "epoch: 2, batch: 18600, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 18800, loss is; [0.23897158]\n",
      "epoch: 2, batch: 19000, loss is; [0.]\n",
      "epoch: 2, batch: 19200, loss is; [7.15256e-07]\n",
      "epoch: 2, batch: 19400, loss is; [0.]\n",
      "epoch: 2, batch: 19600, loss is; [0.]\n",
      "epoch: 2, batch: 19800, loss is; [0.]\n",
      "epoch: 2, batch: 20000, loss is; [0.]\n",
      "epoch: 2, batch: 20200, loss is; [0.5253565]\n",
      "epoch: 2, batch: 20400, loss is; [0.]\n",
      "epoch: 2, batch: 20600, loss is; [0.]\n",
      "epoch: 2, batch: 20800, loss is; [0.]\n",
      "epoch: 2, batch: 21000, loss is; [0.]\n",
      "epoch: 2, batch: 21200, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 21400, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 21600, loss is; [0.]\n",
      "epoch: 2, batch: 21800, loss is; [0.]\n",
      "epoch: 2, batch: 22000, loss is; [2.6226078e-06]\n",
      "epoch: 2, batch: 22200, loss is; [0.]\n",
      "epoch: 2, batch: 22400, loss is; [7.0335955e-05]\n",
      "epoch: 2, batch: 22600, loss is; [7.15256e-07]\n",
      "epoch: 2, batch: 22800, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 23000, loss is; [0.00953798]\n",
      "epoch: 2, batch: 23200, loss is; [0.]\n",
      "epoch: 2, batch: 23400, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 23600, loss is; [0.]\n",
      "epoch: 2, batch: 23800, loss is; [0.01196366]\n",
      "epoch: 2, batch: 24000, loss is; [0.]\n",
      "epoch: 2, batch: 24200, loss is; [2.4557416e-05]\n",
      "epoch: 2, batch: 24400, loss is; [0.]\n",
      "epoch: 2, batch: 24600, loss is; [0.]\n",
      "epoch: 2, batch: 24800, loss is; [0.]\n",
      "epoch: 2, batch: 25000, loss is; [0.]\n",
      "epoch: 2, batch: 25200, loss is; [2.384186e-07]\n",
      "epoch: 2, batch: 25400, loss is; [0.]\n",
      "epoch: 2, batch: 25600, loss is; [0.]\n",
      "epoch: 2, batch: 25800, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 26000, loss is; [0.]\n",
      "epoch: 2, batch: 26200, loss is; [0.]\n",
      "epoch: 2, batch: 26400, loss is; [0.]\n",
      "epoch: 2, batch: 26600, loss is; [3.1471747e-05]\n",
      "epoch: 2, batch: 26800, loss is; [0.]\n",
      "epoch: 2, batch: 27000, loss is; [0.]\n",
      "epoch: 2, batch: 27200, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 27400, loss is; [0.00044386]\n",
      "epoch: 2, batch: 27600, loss is; [0.01022036]\n",
      "epoch: 2, batch: 27800, loss is; [0.00489076]\n",
      "epoch: 2, batch: 28000, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 28200, loss is; [3.218656e-06]\n",
      "epoch: 2, batch: 28400, loss is; [3.3378658e-06]\n",
      "epoch: 2, batch: 28600, loss is; [0.0038832]\n",
      "epoch: 2, batch: 28800, loss is; [0.]\n",
      "epoch: 2, batch: 29000, loss is; [0.]\n",
      "epoch: 2, batch: 29200, loss is; [0.0002738]\n",
      "epoch: 2, batch: 29400, loss is; [4.768373e-07]\n",
      "epoch: 2, batch: 29600, loss is; [5.173817e-05]\n",
      "epoch: 2, batch: 29800, loss is; [2.861027e-06]\n",
      "epoch: 2, batch: 30000, loss is; [0.]\n",
      "epoch: 2, batch: 30200, loss is; [1.1086526e-05]\n",
      "epoch: 2, batch: 30400, loss is; [0.00501242]\n",
      "epoch: 2, batch: 30600, loss is; [0.5353704]\n",
      "epoch: 2, batch: 30800, loss is; [0.]\n",
      "epoch: 2, batch: 31000, loss is; [3.5762793e-07]\n",
      "epoch: 2, batch: 31200, loss is; [7.5102134e-06]\n",
      "epoch: 2, batch: 31400, loss is; [7.15256e-07]\n",
      "epoch: 2, batch: 31600, loss is; [0.]\n",
      "epoch: 2, batch: 31800, loss is; [0.]\n",
      "epoch: 2, batch: 32000, loss is; [0.]\n",
      "epoch: 2, batch: 32200, loss is; [6.735552e-05]\n",
      "epoch: 2, batch: 32400, loss is; [0.]\n",
      "epoch: 2, batch: 32600, loss is; [3.5762793e-07]\n",
      "epoch: 2, batch: 32800, loss is; [0.]\n",
      "epoch: 2, batch: 33000, loss is; [1.5497328e-05]\n",
      "epoch: 2, batch: 33200, loss is; [0.]\n",
      "epoch: 2, batch: 33400, loss is; [0.]\n",
      "epoch: 2, batch: 33600, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 33800, loss is; [0.]\n",
      "epoch: 2, batch: 34000, loss is; [0.]\n",
      "epoch: 2, batch: 34200, loss is; [0.]\n",
      "epoch: 2, batch: 34400, loss is; [0.]\n",
      "epoch: 2, batch: 34600, loss is; [4.172334e-06]\n",
      "epoch: 2, batch: 34800, loss is; [9.536748e-07]\n",
      "epoch: 2, batch: 35000, loss is; [0.]\n",
      "epoch: 2, batch: 35200, loss is; [0.]\n",
      "epoch: 2, batch: 35400, loss is; [0.]\n",
      "epoch: 2, batch: 35600, loss is; [4.768373e-07]\n",
      "epoch: 2, batch: 35800, loss is; [0.]\n",
      "epoch: 2, batch: 36000, loss is; [0.]\n",
      "epoch: 2, batch: 36200, loss is; [0.]\n",
      "epoch: 2, batch: 36400, loss is; [0.]\n",
      "epoch: 2, batch: 36600, loss is; [0.]\n",
      "epoch: 2, batch: 36800, loss is; [0.]\n",
      "epoch: 2, batch: 37000, loss is; [0.04391326]\n",
      "epoch: 2, batch: 37200, loss is; [0.]\n",
      "epoch: 2, batch: 37400, loss is; [0.]\n",
      "epoch: 2, batch: 37600, loss is; [0.]\n",
      "epoch: 2, batch: 37800, loss is; [0.]\n",
      "epoch: 2, batch: 38000, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 38200, loss is; [0.10859296]\n",
      "epoch: 2, batch: 38400, loss is; [0.]\n",
      "epoch: 2, batch: 38600, loss is; [0.]\n",
      "epoch: 2, batch: 38800, loss is; [0.]\n",
      "epoch: 2, batch: 39000, loss is; [0.]\n",
      "epoch: 2, batch: 39200, loss is; [0.]\n",
      "epoch: 2, batch: 39400, loss is; [2.3841887e-06]\n",
      "epoch: 2, batch: 39600, loss is; [8.7265005e-05]\n",
      "epoch: 2, batch: 39800, loss is; [1.180179e-05]\n",
      "epoch: 2, batch: 40000, loss is; [0.]\n",
      "epoch: 2, batch: 40200, loss is; [0.00038226]\n",
      "epoch: 2, batch: 40400, loss is; [0.]\n",
      "epoch: 2, batch: 40600, loss is; [0.]\n",
      "epoch: 2, batch: 40800, loss is; [0.0545495]\n",
      "epoch: 2, batch: 41000, loss is; [4.649173e-06]\n",
      "epoch: 2, batch: 41200, loss is; [0.]\n",
      "epoch: 2, batch: 41400, loss is; [0.]\n",
      "epoch: 2, batch: 41600, loss is; [0.]\n",
      "epoch: 2, batch: 41800, loss is; [1.1920936e-06]\n",
      "epoch: 2, batch: 42000, loss is; [0.]\n",
      "epoch: 2, batch: 42200, loss is; [0.00057285]\n",
      "epoch: 2, batch: 42400, loss is; [0.00055382]\n",
      "epoch: 2, batch: 42600, loss is; [0.]\n",
      "epoch: 2, batch: 42800, loss is; [0.]\n",
      "epoch: 2, batch: 43000, loss is; [0.00086297]\n",
      "epoch: 2, batch: 43200, loss is; [0.]\n",
      "epoch: 2, batch: 43400, loss is; [0.]\n",
      "epoch: 2, batch: 43600, loss is; [1.5378117e-05]\n",
      "epoch: 2, batch: 43800, loss is; [0.]\n",
      "epoch: 2, batch: 44000, loss is; [1.6808652e-05]\n",
      "epoch: 2, batch: 44200, loss is; [3.0160405e-05]\n",
      "epoch: 2, batch: 44400, loss is; [0.00131174]\n",
      "epoch: 2, batch: 44600, loss is; [1.0728842e-06]\n",
      "epoch: 2, batch: 44800, loss is; [0.]\n",
      "epoch: 2, batch: 45000, loss is; [0.]\n",
      "epoch: 2, batch: 45200, loss is; [1.6689314e-06]\n",
      "epoch: 2, batch: 45400, loss is; [0.]\n",
      "epoch: 2, batch: 45600, loss is; [0.]\n",
      "epoch: 2, batch: 45800, loss is; [0.]\n",
      "epoch: 2, batch: 46000, loss is; [0.]\n",
      "epoch: 2, batch: 46200, loss is; [0.]\n",
      "epoch: 2, batch: 46400, loss is; [4.768373e-07]\n",
      "epoch: 2, batch: 46600, loss is; [5.960466e-07]\n",
      "epoch: 2, batch: 46800, loss is; [0.]\n",
      "epoch: 2, batch: 47000, loss is; [0.00683552]\n",
      "epoch: 2, batch: 47200, loss is; [0.00040271]\n",
      "epoch: 2, batch: 47400, loss is; [1.4305125e-06]\n",
      "epoch: 2, batch: 47600, loss is; [4.768373e-07]\n",
      "epoch: 2, batch: 47800, loss is; [3.516736e-05]\n",
      "epoch: 2, batch: 48000, loss is; [0.03225249]\n",
      "epoch: 2, batch: 48200, loss is; [0.]\n",
      "epoch: 2, batch: 48400, loss is; [0.]\n",
      "epoch: 2, batch: 48600, loss is; [0.]\n",
      "epoch: 2, batch: 48800, loss is; [0.]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 2, batch: 49000, loss is; [1.192093e-07]\n",
      "epoch: 2, batch: 49200, loss is; [2.062342e-05]\n",
      "epoch: 2, batch: 49400, loss is; [0.00041213]\n",
      "epoch: 2, batch: 49600, loss is; [3.516736e-05]\n",
      "epoch: 2, batch: 49800, loss is; [0.]\n",
      "epoch: 3, batch: 0, loss is; [0.]\n",
      "epoch: 3, batch: 200, loss is; [0.]\n",
      "epoch: 3, batch: 400, loss is; [0.]\n",
      "epoch: 3, batch: 600, loss is; [2.5033983e-06]\n",
      "epoch: 3, batch: 800, loss is; [0.]\n",
      "epoch: 3, batch: 1000, loss is; [0.]\n",
      "epoch: 3, batch: 1200, loss is; [0.]\n",
      "epoch: 3, batch: 1400, loss is; [0.00227943]\n",
      "epoch: 3, batch: 1600, loss is; [0.]\n",
      "epoch: 3, batch: 1800, loss is; [0.]\n",
      "epoch: 3, batch: 2000, loss is; [8.3446537e-07]\n",
      "epoch: 3, batch: 2200, loss is; [0.]\n",
      "epoch: 3, batch: 2400, loss is; [3.5762793e-07]\n",
      "epoch: 3, batch: 2600, loss is; [0.]\n",
      "epoch: 3, batch: 2800, loss is; [0.]\n",
      "epoch: 3, batch: 3000, loss is; [1.4305125e-06]\n",
      "epoch: 3, batch: 3200, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 3400, loss is; [0.]\n",
      "epoch: 3, batch: 3600, loss is; [0.]\n",
      "epoch: 3, batch: 3800, loss is; [0.]\n",
      "epoch: 3, batch: 4000, loss is; [2.6226078e-06]\n",
      "epoch: 3, batch: 4200, loss is; [1.0252052e-05]\n",
      "epoch: 3, batch: 4400, loss is; [0.]\n",
      "epoch: 3, batch: 4600, loss is; [6.0796924e-06]\n",
      "epoch: 3, batch: 4800, loss is; [0.]\n",
      "epoch: 3, batch: 5000, loss is; [0.]\n",
      "epoch: 3, batch: 5200, loss is; [0.00721158]\n",
      "epoch: 3, batch: 5400, loss is; [0.]\n",
      "epoch: 3, batch: 5600, loss is; [0.10166118]\n",
      "epoch: 3, batch: 5800, loss is; [0.15394013]\n",
      "epoch: 3, batch: 6000, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 6200, loss is; [7.15256e-07]\n",
      "epoch: 3, batch: 6400, loss is; [0.]\n",
      "epoch: 3, batch: 6600, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 6800, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 7000, loss is; [0.00125511]\n",
      "epoch: 3, batch: 7200, loss is; [0.]\n",
      "epoch: 3, batch: 7400, loss is; [0.00027499]\n",
      "epoch: 3, batch: 7600, loss is; [4.768373e-07]\n",
      "epoch: 3, batch: 7800, loss is; [0.]\n",
      "epoch: 3, batch: 8000, loss is; [7.3910032e-06]\n",
      "epoch: 3, batch: 8200, loss is; [3.5762793e-07]\n",
      "epoch: 3, batch: 8400, loss is; [1.4305125e-06]\n",
      "epoch: 3, batch: 8600, loss is; [0.]\n",
      "epoch: 3, batch: 8800, loss is; [0.]\n",
      "epoch: 3, batch: 9000, loss is; [4.2081763e-05]\n",
      "epoch: 3, batch: 9200, loss is; [0.00016512]\n",
      "epoch: 3, batch: 9400, loss is; [0.]\n",
      "epoch: 3, batch: 9600, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 9800, loss is; [0.]\n",
      "epoch: 3, batch: 10000, loss is; [2.02656e-06]\n",
      "epoch: 3, batch: 10200, loss is; [0.]\n",
      "epoch: 3, batch: 10400, loss is; [7.15256e-07]\n",
      "epoch: 3, batch: 10600, loss is; [1.990815e-05]\n",
      "epoch: 3, batch: 10800, loss is; [0.]\n",
      "epoch: 3, batch: 11000, loss is; [4.410655]\n",
      "epoch: 3, batch: 11200, loss is; [7.15256e-07]\n",
      "epoch: 3, batch: 11400, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 11600, loss is; [0.00102585]\n",
      "epoch: 3, batch: 11800, loss is; [0.]\n",
      "epoch: 3, batch: 12000, loss is; [0.]\n",
      "epoch: 3, batch: 12200, loss is; [0.]\n",
      "epoch: 3, batch: 12400, loss is; [9.6444965e-05]\n",
      "epoch: 3, batch: 12600, loss is; [0.]\n",
      "epoch: 3, batch: 12800, loss is; [0.]\n",
      "epoch: 3, batch: 13000, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 13200, loss is; [4.768373e-07]\n",
      "epoch: 3, batch: 13400, loss is; [5.960466e-07]\n",
      "epoch: 3, batch: 13600, loss is; [0.]\n",
      "epoch: 3, batch: 13800, loss is; [0.]\n",
      "epoch: 3, batch: 14000, loss is; [0.]\n",
      "epoch: 3, batch: 14200, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 14400, loss is; [7.15256e-07]\n",
      "epoch: 3, batch: 14600, loss is; [0.]\n",
      "epoch: 3, batch: 14800, loss is; [0.]\n",
      "epoch: 3, batch: 15000, loss is; [8.3446537e-07]\n",
      "epoch: 3, batch: 15200, loss is; [0.]\n",
      "epoch: 3, batch: 15400, loss is; [0.]\n",
      "epoch: 3, batch: 15600, loss is; [0.]\n",
      "epoch: 3, batch: 15800, loss is; [0.]\n",
      "epoch: 3, batch: 16000, loss is; [0.]\n",
      "epoch: 3, batch: 16200, loss is; [1.3113108e-05]\n",
      "epoch: 3, batch: 16400, loss is; [2.02656e-06]\n",
      "epoch: 3, batch: 16600, loss is; [4.1485695e-05]\n",
      "epoch: 3, batch: 16800, loss is; [5.7220623e-06]\n",
      "epoch: 3, batch: 17000, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 17200, loss is; [3.588264e-05]\n",
      "epoch: 3, batch: 17400, loss is; [0.]\n",
      "epoch: 3, batch: 17600, loss is; [4.768373e-07]\n",
      "epoch: 3, batch: 17800, loss is; [0.]\n",
      "epoch: 3, batch: 18000, loss is; [0.]\n",
      "epoch: 3, batch: 18200, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 18400, loss is; [5.1260126e-06]\n",
      "epoch: 3, batch: 18600, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 18800, loss is; [0.]\n",
      "epoch: 3, batch: 19000, loss is; [0.]\n",
      "epoch: 3, batch: 19200, loss is; [0.00020119]\n",
      "epoch: 3, batch: 19400, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 19600, loss is; [0.]\n",
      "epoch: 3, batch: 19800, loss is; [0.]\n",
      "epoch: 3, batch: 20000, loss is; [8.3446537e-07]\n",
      "epoch: 3, batch: 20200, loss is; [0.]\n",
      "epoch: 3, batch: 20400, loss is; [3.0994463e-06]\n",
      "epoch: 3, batch: 20600, loss is; [0.]\n",
      "epoch: 3, batch: 20800, loss is; [0.00082235]\n",
      "epoch: 3, batch: 21000, loss is; [8.3446537e-07]\n",
      "epoch: 3, batch: 21200, loss is; [0.]\n",
      "epoch: 3, batch: 21400, loss is; [0.]\n",
      "epoch: 3, batch: 21600, loss is; [0.]\n",
      "epoch: 3, batch: 21800, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 22000, loss is; [3.4570753e-06]\n",
      "epoch: 3, batch: 22200, loss is; [1.001363e-05]\n",
      "epoch: 3, batch: 22400, loss is; [0.]\n",
      "epoch: 3, batch: 22600, loss is; [9.536748e-07]\n",
      "epoch: 3, batch: 22800, loss is; [1.919288e-05]\n",
      "epoch: 3, batch: 23000, loss is; [4.5299635e-06]\n",
      "epoch: 3, batch: 23200, loss is; [5.960466e-07]\n",
      "epoch: 3, batch: 23400, loss is; [0.]\n",
      "epoch: 3, batch: 23600, loss is; [0.]\n",
      "epoch: 3, batch: 23800, loss is; [0.]\n",
      "epoch: 3, batch: 24000, loss is; [3.4570753e-06]\n",
      "epoch: 3, batch: 24200, loss is; [0.]\n",
      "epoch: 3, batch: 24400, loss is; [0.]\n",
      "epoch: 3, batch: 24600, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 24800, loss is; [0.]\n",
      "epoch: 3, batch: 25000, loss is; [0.]\n",
      "epoch: 3, batch: 25200, loss is; [0.]\n",
      "epoch: 3, batch: 25400, loss is; [0.]\n",
      "epoch: 3, batch: 25600, loss is; [0.]\n",
      "epoch: 3, batch: 25800, loss is; [1.7881409e-06]\n",
      "epoch: 3, batch: 26000, loss is; [0.]\n",
      "epoch: 3, batch: 26200, loss is; [0.]\n",
      "epoch: 3, batch: 26400, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 26600, loss is; [0.]\n",
      "epoch: 3, batch: 26800, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 27000, loss is; [7.152583e-06]\n",
      "epoch: 3, batch: 27200, loss is; [0.]\n",
      "epoch: 3, batch: 27400, loss is; [3.5762793e-07]\n",
      "epoch: 3, batch: 27600, loss is; [0.]\n",
      "epoch: 3, batch: 27800, loss is; [1.1920936e-06]\n",
      "epoch: 3, batch: 28000, loss is; [0.]\n",
      "epoch: 3, batch: 28200, loss is; [0.]\n",
      "epoch: 3, batch: 28400, loss is; [1.9349726]\n",
      "epoch: 3, batch: 28600, loss is; [0.]\n",
      "epoch: 3, batch: 28800, loss is; [0.]\n",
      "epoch: 3, batch: 29000, loss is; [0.]\n",
      "epoch: 3, batch: 29200, loss is; [0.]\n",
      "epoch: 3, batch: 29400, loss is; [0.]\n",
      "epoch: 3, batch: 29600, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 29800, loss is; [1.5258905e-05]\n",
      "epoch: 3, batch: 30000, loss is; [0.]\n",
      "epoch: 3, batch: 30200, loss is; [0.]\n",
      "epoch: 3, batch: 30400, loss is; [8.702316e-06]\n",
      "epoch: 3, batch: 30600, loss is; [1.3113031e-06]\n",
      "epoch: 3, batch: 30800, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 31000, loss is; [1.7881409e-06]\n",
      "epoch: 3, batch: 31200, loss is; [0.]\n",
      "epoch: 3, batch: 31400, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 31600, loss is; [0.]\n",
      "epoch: 3, batch: 31800, loss is; [9.978315e-05]\n",
      "epoch: 3, batch: 32000, loss is; [2.3484507e-05]\n",
      "epoch: 3, batch: 32200, loss is; [4.768373e-07]\n",
      "epoch: 3, batch: 32400, loss is; [3.5762793e-07]\n",
      "epoch: 3, batch: 32600, loss is; [0.]\n",
      "epoch: 3, batch: 32800, loss is; [0.00011934]\n",
      "epoch: 3, batch: 33000, loss is; [0.]\n",
      "epoch: 3, batch: 33200, loss is; [1.6689314e-06]\n",
      "epoch: 3, batch: 33400, loss is; [0.]\n",
      "epoch: 3, batch: 33600, loss is; [0.]\n",
      "epoch: 3, batch: 33800, loss is; [0.]\n",
      "epoch: 3, batch: 34000, loss is; [0.]\n",
      "epoch: 3, batch: 34200, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 34400, loss is; [0.]\n",
      "epoch: 3, batch: 34600, loss is; [0.]\n",
      "epoch: 3, batch: 34800, loss is; [0.]\n",
      "epoch: 3, batch: 35000, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 35200, loss is; [0.]\n",
      "epoch: 3, batch: 35400, loss is; [3.5762793e-07]\n",
      "epoch: 3, batch: 35600, loss is; [1.2040211e-05]\n",
      "epoch: 3, batch: 35800, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 36000, loss is; [0.]\n",
      "epoch: 3, batch: 36200, loss is; [0.]\n",
      "epoch: 3, batch: 36400, loss is; [0.]\n",
      "epoch: 3, batch: 36600, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 36800, loss is; [6.819004e-05]\n",
      "epoch: 3, batch: 37000, loss is; [8.8215265e-06]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 3, batch: 37200, loss is; [3.5762793e-07]\n",
      "epoch: 3, batch: 37400, loss is; [3.039883e-05]\n",
      "epoch: 3, batch: 37600, loss is; [0.]\n",
      "epoch: 3, batch: 37800, loss is; [0.]\n",
      "epoch: 3, batch: 38000, loss is; [0.]\n",
      "epoch: 3, batch: 38200, loss is; [0.00018461]\n",
      "epoch: 3, batch: 38400, loss is; [0.00010586]\n",
      "epoch: 3, batch: 38600, loss is; [0.]\n",
      "epoch: 3, batch: 38800, loss is; [0.]\n",
      "epoch: 3, batch: 39000, loss is; [6.5565323e-06]\n",
      "epoch: 3, batch: 39200, loss is; [2.6226078e-06]\n",
      "epoch: 3, batch: 39400, loss is; [0.]\n",
      "epoch: 3, batch: 39600, loss is; [0.]\n",
      "epoch: 3, batch: 39800, loss is; [3.576285e-06]\n",
      "epoch: 3, batch: 40000, loss is; [0.]\n",
      "epoch: 3, batch: 40200, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 40400, loss is; [0.]\n",
      "epoch: 3, batch: 40600, loss is; [0.0003119]\n",
      "epoch: 3, batch: 40800, loss is; [0.]\n",
      "epoch: 3, batch: 41000, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 41200, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 41400, loss is; [0.]\n",
      "epoch: 3, batch: 41600, loss is; [2.6226078e-06]\n",
      "epoch: 3, batch: 41800, loss is; [0.]\n",
      "epoch: 3, batch: 42000, loss is; [0.]\n",
      "epoch: 3, batch: 42200, loss is; [0.]\n",
      "epoch: 3, batch: 42400, loss is; [0.03057606]\n",
      "epoch: 3, batch: 42600, loss is; [0.00012339]\n",
      "epoch: 3, batch: 42800, loss is; [6.0440936e-05]\n",
      "epoch: 3, batch: 43000, loss is; [0.]\n",
      "epoch: 3, batch: 43200, loss is; [4.768383e-06]\n",
      "epoch: 3, batch: 43400, loss is; [0.]\n",
      "epoch: 3, batch: 43600, loss is; [0.]\n",
      "epoch: 3, batch: 43800, loss is; [0.]\n",
      "epoch: 3, batch: 44000, loss is; [0.]\n",
      "epoch: 3, batch: 44200, loss is; [0.00333364]\n",
      "epoch: 3, batch: 44400, loss is; [9.536748e-07]\n",
      "epoch: 3, batch: 44600, loss is; [7.15256e-07]\n",
      "epoch: 3, batch: 44800, loss is; [0.]\n",
      "epoch: 3, batch: 45000, loss is; [0.]\n",
      "epoch: 3, batch: 45200, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 45400, loss is; [0.00025031]\n",
      "epoch: 3, batch: 45600, loss is; [0.]\n",
      "epoch: 3, batch: 45800, loss is; [0.]\n",
      "epoch: 3, batch: 46000, loss is; [0.]\n",
      "epoch: 3, batch: 46200, loss is; [8.3446537e-07]\n",
      "epoch: 3, batch: 46400, loss is; [0.]\n",
      "epoch: 3, batch: 46600, loss is; [0.]\n",
      "epoch: 3, batch: 46800, loss is; [4.649173e-06]\n",
      "epoch: 3, batch: 47000, loss is; [0.]\n",
      "epoch: 3, batch: 47200, loss is; [1.9073505e-06]\n",
      "epoch: 3, batch: 47400, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 47600, loss is; [0.00030343]\n",
      "epoch: 3, batch: 47800, loss is; [0.]\n",
      "epoch: 3, batch: 48000, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 48200, loss is; [0.00156352]\n",
      "epoch: 3, batch: 48400, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 48600, loss is; [2.384186e-07]\n",
      "epoch: 3, batch: 48800, loss is; [4.5777415e-05]\n",
      "epoch: 3, batch: 49000, loss is; [0.02988929]\n",
      "epoch: 3, batch: 49200, loss is; [0.13258627]\n",
      "epoch: 3, batch: 49400, loss is; [1.192093e-07]\n",
      "epoch: 3, batch: 49600, loss is; [0.]\n",
      "epoch: 3, batch: 49800, loss is; [0.]\n",
      "epoch: 4, batch: 0, loss is; [0.]\n",
      "epoch: 4, batch: 200, loss is; [0.39937982]\n",
      "epoch: 4, batch: 400, loss is; [0.]\n",
      "epoch: 4, batch: 600, loss is; [0.]\n",
      "epoch: 4, batch: 800, loss is; [0.]\n",
      "epoch: 4, batch: 1000, loss is; [0.]\n",
      "epoch: 4, batch: 1200, loss is; [5.960466e-07]\n",
      "epoch: 4, batch: 1400, loss is; [4.303548e-05]\n",
      "epoch: 4, batch: 1600, loss is; [0.00012887]\n",
      "epoch: 4, batch: 1800, loss is; [3.719399e-05]\n",
      "epoch: 4, batch: 2000, loss is; [5.960466e-07]\n",
      "epoch: 4, batch: 2200, loss is; [2.264979e-06]\n",
      "epoch: 4, batch: 2400, loss is; [0.]\n",
      "epoch: 4, batch: 2600, loss is; [9.417578e-06]\n",
      "epoch: 4, batch: 2800, loss is; [8.8215265e-06]\n",
      "epoch: 4, batch: 3000, loss is; [0.]\n",
      "epoch: 4, batch: 3200, loss is; [0.]\n",
      "epoch: 4, batch: 3400, loss is; [0.]\n",
      "epoch: 4, batch: 3600, loss is; [7.15256e-07]\n",
      "epoch: 4, batch: 3800, loss is; [0.]\n",
      "epoch: 4, batch: 4000, loss is; [0.00011969]\n",
      "epoch: 4, batch: 4200, loss is; [0.]\n",
      "epoch: 4, batch: 4400, loss is; [1.6689314e-06]\n",
      "epoch: 4, batch: 4600, loss is; [0.]\n",
      "epoch: 4, batch: 4800, loss is; [0.]\n",
      "epoch: 4, batch: 5000, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 5200, loss is; [3.5762793e-07]\n",
      "epoch: 4, batch: 5400, loss is; [0.]\n",
      "epoch: 4, batch: 5600, loss is; [0.]\n",
      "epoch: 4, batch: 5800, loss is; [0.]\n",
      "epoch: 4, batch: 6000, loss is; [5.1857387e-05]\n",
      "epoch: 4, batch: 6200, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 6400, loss is; [0.]\n",
      "epoch: 4, batch: 6600, loss is; [0.]\n",
      "epoch: 4, batch: 6800, loss is; [4.768373e-07]\n",
      "epoch: 4, batch: 7000, loss is; [5.1857387e-05]\n",
      "epoch: 4, batch: 7200, loss is; [0.]\n",
      "epoch: 4, batch: 7400, loss is; [0.02988615]\n",
      "epoch: 4, batch: 7600, loss is; [0.]\n",
      "epoch: 4, batch: 7800, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 8000, loss is; [0.]\n",
      "epoch: 4, batch: 8200, loss is; [0.]\n",
      "epoch: 4, batch: 8400, loss is; [4.768373e-07]\n",
      "epoch: 4, batch: 8600, loss is; [0.02820154]\n",
      "epoch: 4, batch: 8800, loss is; [0.]\n",
      "epoch: 4, batch: 9000, loss is; [0.]\n",
      "epoch: 4, batch: 9200, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 9400, loss is; [0.]\n",
      "epoch: 4, batch: 9600, loss is; [0.00012303]\n",
      "epoch: 4, batch: 9800, loss is; [0.]\n",
      "epoch: 4, batch: 10000, loss is; [0.]\n",
      "epoch: 4, batch: 10200, loss is; [0.]\n",
      "epoch: 4, batch: 10400, loss is; [0.]\n",
      "epoch: 4, batch: 10600, loss is; [7.0333726e-06]\n",
      "epoch: 4, batch: 10800, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 11000, loss is; [0.]\n",
      "epoch: 4, batch: 11200, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 11400, loss is; [0.]\n",
      "epoch: 4, batch: 11600, loss is; [5.960482e-06]\n",
      "epoch: 4, batch: 11800, loss is; [0.]\n",
      "epoch: 4, batch: 12000, loss is; [0.]\n",
      "epoch: 4, batch: 12200, loss is; [0.]\n",
      "epoch: 4, batch: 12400, loss is; [0.]\n",
      "epoch: 4, batch: 12600, loss is; [1.6689314e-06]\n",
      "epoch: 4, batch: 12800, loss is; [2.9683553e-05]\n",
      "epoch: 4, batch: 13000, loss is; [0.14954524]\n",
      "epoch: 4, batch: 13200, loss is; [0.00014497]\n",
      "epoch: 4, batch: 13400, loss is; [0.01212497]\n",
      "epoch: 4, batch: 13600, loss is; [0.]\n",
      "epoch: 4, batch: 13800, loss is; [0.]\n",
      "epoch: 4, batch: 14000, loss is; [8.3446537e-07]\n",
      "epoch: 4, batch: 14200, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 14400, loss is; [0.]\n",
      "epoch: 4, batch: 14600, loss is; [3.5762793e-07]\n",
      "epoch: 4, batch: 14800, loss is; [6.4373226e-06]\n",
      "epoch: 4, batch: 15000, loss is; [0.]\n",
      "epoch: 4, batch: 15200, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 15400, loss is; [0.]\n",
      "epoch: 4, batch: 15600, loss is; [3.2425454e-05]\n",
      "epoch: 4, batch: 15800, loss is; [0.]\n",
      "epoch: 4, batch: 16000, loss is; [0.00079431]\n",
      "epoch: 4, batch: 16200, loss is; [0.]\n",
      "epoch: 4, batch: 16400, loss is; [0.]\n",
      "epoch: 4, batch: 16600, loss is; [0.]\n",
      "epoch: 4, batch: 16800, loss is; [9.680263e-05]\n",
      "epoch: 4, batch: 17000, loss is; [4.3869983e-05]\n",
      "epoch: 4, batch: 17200, loss is; [0.]\n",
      "epoch: 4, batch: 17400, loss is; [0.]\n",
      "epoch: 4, batch: 17600, loss is; [0.]\n",
      "epoch: 4, batch: 17800, loss is; [4.768383e-06]\n",
      "epoch: 4, batch: 18000, loss is; [0.]\n",
      "epoch: 4, batch: 18200, loss is; [0.00915581]\n",
      "epoch: 4, batch: 18400, loss is; [0.]\n",
      "epoch: 4, batch: 18600, loss is; [8.702316e-06]\n",
      "epoch: 4, batch: 18800, loss is; [0.]\n",
      "epoch: 4, batch: 19000, loss is; [0.00051357]\n",
      "epoch: 4, batch: 19200, loss is; [3.218656e-06]\n",
      "epoch: 4, batch: 19400, loss is; [0.]\n",
      "epoch: 4, batch: 19600, loss is; [0.00462306]\n",
      "epoch: 4, batch: 19800, loss is; [0.]\n",
      "epoch: 4, batch: 20000, loss is; [0.]\n",
      "epoch: 4, batch: 20200, loss is; [0.]\n",
      "epoch: 4, batch: 20400, loss is; [0.]\n",
      "epoch: 4, batch: 20600, loss is; [2.1131437]\n",
      "epoch: 4, batch: 20800, loss is; [0.]\n",
      "epoch: 4, batch: 21000, loss is; [1.3113031e-06]\n",
      "epoch: 4, batch: 21200, loss is; [0.0367753]\n",
      "epoch: 4, batch: 21400, loss is; [0.]\n",
      "epoch: 4, batch: 21600, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 21800, loss is; [0.00038285]\n",
      "epoch: 4, batch: 22000, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 22200, loss is; [0.]\n",
      "epoch: 4, batch: 22400, loss is; [0.]\n",
      "epoch: 4, batch: 22600, loss is; [8.0827165e-05]\n",
      "epoch: 4, batch: 22800, loss is; [1.0728842e-06]\n",
      "epoch: 4, batch: 23000, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 23200, loss is; [0.]\n",
      "epoch: 4, batch: 23400, loss is; [0.]\n",
      "epoch: 4, batch: 23600, loss is; [4.768373e-07]\n",
      "epoch: 4, batch: 23800, loss is; [0.]\n",
      "epoch: 4, batch: 24000, loss is; [0.]\n",
      "epoch: 4, batch: 24200, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 24400, loss is; [0.]\n",
      "epoch: 4, batch: 24600, loss is; [1.5258905e-05]\n",
      "epoch: 4, batch: 24800, loss is; [5.3644326e-06]\n",
      "epoch: 4, batch: 25000, loss is; [0.]\n",
      "epoch: 4, batch: 25200, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 25400, loss is; [0.]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 4, batch: 25600, loss is; [0.]\n",
      "epoch: 4, batch: 25800, loss is; [0.]\n",
      "epoch: 4, batch: 26000, loss is; [0.]\n",
      "epoch: 4, batch: 26200, loss is; [2.5033983e-06]\n",
      "epoch: 4, batch: 26400, loss is; [7.152583e-06]\n",
      "epoch: 4, batch: 26600, loss is; [0.]\n",
      "epoch: 4, batch: 26800, loss is; [0.00024924]\n",
      "epoch: 4, batch: 27000, loss is; [0.]\n",
      "epoch: 4, batch: 27200, loss is; [0.]\n",
      "epoch: 4, batch: 27400, loss is; [0.]\n",
      "epoch: 4, batch: 27600, loss is; [1.3589952e-05]\n",
      "epoch: 4, batch: 27800, loss is; [0.]\n",
      "epoch: 4, batch: 28000, loss is; [0.00032204]\n",
      "epoch: 4, batch: 28200, loss is; [0.]\n",
      "epoch: 4, batch: 28400, loss is; [0.]\n",
      "epoch: 4, batch: 28600, loss is; [0.]\n",
      "epoch: 4, batch: 28800, loss is; [2.527269e-05]\n",
      "epoch: 4, batch: 29000, loss is; [0.]\n",
      "epoch: 4, batch: 29200, loss is; [1.3113031e-06]\n",
      "epoch: 4, batch: 29400, loss is; [0.]\n",
      "epoch: 4, batch: 29600, loss is; [0.]\n",
      "epoch: 4, batch: 29800, loss is; [0.]\n",
      "epoch: 4, batch: 30000, loss is; [4.768373e-07]\n",
      "epoch: 4, batch: 30200, loss is; [0.00128089]\n",
      "epoch: 4, batch: 30400, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 30600, loss is; [5.7341313e-05]\n",
      "epoch: 4, batch: 30800, loss is; [0.]\n",
      "epoch: 4, batch: 31000, loss is; [0.]\n",
      "epoch: 4, batch: 31200, loss is; [3.0290973]\n",
      "epoch: 4, batch: 31400, loss is; [1.3485446]\n",
      "epoch: 4, batch: 31600, loss is; [0.]\n",
      "epoch: 4, batch: 31800, loss is; [2.384186e-07]\n",
      "epoch: 4, batch: 32000, loss is; [0.]\n",
      "epoch: 4, batch: 32200, loss is; [0.4448185]\n",
      "epoch: 4, batch: 32400, loss is; [3.7790058e-05]\n",
      "epoch: 4, batch: 32600, loss is; [5.7220623e-06]\n",
      "epoch: 4, batch: 32800, loss is; [9.536748e-07]\n",
      "epoch: 4, batch: 33000, loss is; [0.]\n",
      "epoch: 4, batch: 33200, loss is; [0.]\n",
      "epoch: 4, batch: 33400, loss is; [0.]\n",
      "epoch: 4, batch: 33600, loss is; [0.]\n",
      "epoch: 4, batch: 33800, loss is; [5.960466e-07]\n",
      "epoch: 4, batch: 34000, loss is; [1.01328405e-05]\n",
      "epoch: 4, batch: 34200, loss is; [9.536748e-07]\n",
      "epoch: 4, batch: 34400, loss is; [0.]\n",
      "epoch: 4, batch: 34600, loss is; [4.768373e-07]\n",
      "epoch: 4, batch: 34800, loss is; [0.]\n",
      "epoch: 4, batch: 35000, loss is; [3.910141e-05]\n",
      "epoch: 4, batch: 35200, loss is; [0.]\n",
      "epoch: 4, batch: 35400, loss is; [0.]\n",
      "epoch: 4, batch: 35600, loss is; [0.]\n",
      "epoch: 4, batch: 35800, loss is; [0.]\n",
      "epoch: 4, batch: 36000, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 36200, loss is; [7.867844e-06]\n",
      "epoch: 4, batch: 36400, loss is; [9.143771e-05]\n",
      "epoch: 4, batch: 36600, loss is; [0.]\n",
      "epoch: 4, batch: 36800, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 37000, loss is; [0.]\n",
      "epoch: 4, batch: 37200, loss is; [0.]\n",
      "epoch: 4, batch: 37400, loss is; [1.0728842e-06]\n",
      "epoch: 4, batch: 37600, loss is; [3.3617584e-05]\n",
      "epoch: 4, batch: 37800, loss is; [2.6941663e-05]\n",
      "epoch: 4, batch: 38000, loss is; [0.00028835]\n",
      "epoch: 4, batch: 38200, loss is; [5.614915e-05]\n",
      "epoch: 4, batch: 38400, loss is; [0.00104661]\n",
      "epoch: 4, batch: 38600, loss is; [0.00125129]\n",
      "epoch: 4, batch: 38800, loss is; [8.3446537e-07]\n",
      "epoch: 4, batch: 39000, loss is; [0.]\n",
      "epoch: 4, batch: 39200, loss is; [3.5762793e-07]\n",
      "epoch: 4, batch: 39400, loss is; [9.727951e-05]\n",
      "epoch: 4, batch: 39600, loss is; [0.]\n",
      "epoch: 4, batch: 39800, loss is; [0.]\n",
      "epoch: 4, batch: 40000, loss is; [0.]\n",
      "epoch: 4, batch: 40200, loss is; [0.00037248]\n",
      "epoch: 4, batch: 40400, loss is; [0.]\n",
      "epoch: 4, batch: 40600, loss is; [0.23129354]\n",
      "epoch: 4, batch: 40800, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 41000, loss is; [0.]\n",
      "epoch: 4, batch: 41200, loss is; [5.746053e-05]\n",
      "epoch: 4, batch: 41400, loss is; [0.]\n",
      "epoch: 4, batch: 41600, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 41800, loss is; [0.]\n",
      "epoch: 4, batch: 42000, loss is; [0.00075512]\n",
      "epoch: 4, batch: 42200, loss is; [5.1260126e-06]\n",
      "epoch: 4, batch: 42400, loss is; [0.]\n",
      "epoch: 4, batch: 42600, loss is; [0.]\n",
      "epoch: 4, batch: 42800, loss is; [0.]\n",
      "epoch: 4, batch: 43000, loss is; [0.]\n",
      "epoch: 4, batch: 43200, loss is; [0.]\n",
      "epoch: 4, batch: 43400, loss is; [4.7922287]\n",
      "epoch: 4, batch: 43600, loss is; [0.]\n",
      "epoch: 4, batch: 43800, loss is; [0.]\n",
      "epoch: 4, batch: 44000, loss is; [0.]\n",
      "epoch: 4, batch: 44200, loss is; [6.3181124e-06]\n",
      "epoch: 4, batch: 44400, loss is; [0.]\n",
      "epoch: 4, batch: 44600, loss is; [0.]\n",
      "epoch: 4, batch: 44800, loss is; [0.]\n",
      "epoch: 4, batch: 45000, loss is; [0.00186593]\n",
      "epoch: 4, batch: 45200, loss is; [2.9802368e-06]\n",
      "epoch: 4, batch: 45400, loss is; [4.768373e-07]\n",
      "epoch: 4, batch: 45600, loss is; [0.]\n",
      "epoch: 4, batch: 45800, loss is; [0.00031166]\n",
      "epoch: 4, batch: 46000, loss is; [0.]\n",
      "epoch: 4, batch: 46200, loss is; [0.]\n",
      "epoch: 4, batch: 46400, loss is; [0.]\n",
      "epoch: 4, batch: 46600, loss is; [0.]\n",
      "epoch: 4, batch: 46800, loss is; [0.00041082]\n",
      "epoch: 4, batch: 47000, loss is; [3.5762793e-07]\n",
      "epoch: 4, batch: 47200, loss is; [1.192093e-07]\n",
      "epoch: 4, batch: 47400, loss is; [0.]\n",
      "epoch: 4, batch: 47600, loss is; [0.]\n",
      "epoch: 4, batch: 47800, loss is; [0.]\n",
      "epoch: 4, batch: 48000, loss is; [0.]\n",
      "epoch: 4, batch: 48200, loss is; [0.]\n",
      "epoch: 4, batch: 48400, loss is; [0.]\n",
      "epoch: 4, batch: 48600, loss is; [0.]\n",
      "epoch: 4, batch: 48800, loss is; [0.]\n",
      "epoch: 4, batch: 49000, loss is; [0.]\n",
      "epoch: 4, batch: 49200, loss is; [0.]\n",
      "epoch: 4, batch: 49400, loss is; [0.]\n",
      "epoch: 4, batch: 49600, loss is; [3.5762793e-07]\n",
      "epoch: 4, batch: 49800, loss is; [0.]\n"
     ]
    }
   ],
   "source": [
    "train_loader=load_data('train')\n",
    "valid_loader=load_data('valid')\n",
    "model=LeNetModel()\n",
    "train(model)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "paddle.save(model.state_dict(),'mnist-cnn.pdparams')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "from PIL import Image \n",
    "import numpy as np\n",
    "im = Image.open('../Desktop/0.jpg').convert('L')\n",
    "im = im.resize((28,28),Image.ANTIALIAS)\n",
    "img = np.array(im).reshape(1,1,28,28).astype('float32')\n",
    "img =1.0-img/255."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.figure(figsize=(2,2))\n",
    "plt.imshow(im, cmap=plt.cm.binary)\n",
    "plt.show() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "本次预测的数字是: 0\n"
     ]
    }
   ],
   "source": [
    "model = LeNetModel()\n",
    "params_file_path ='mnist-cnn.pdparams' \n",
    "param_dict = paddle.load(params_file_path) \n",
    "model.load_dict(param_dict)\n",
    "tensor_img =img\n",
    "results = model(paddle.to_tensor(tensor_img))\n",
    "lab = np.argsort(results.numpy())\n",
    "print('本次预测的数字是:',lab[0][-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
